<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta name="author" content="lushu">
		<title>帐户余额明细</title>
		<script type="text/javascript" language="javascript" src="../script/common.js"></script>
		<script type="text/javascript" language="javascript">
			var Page;
			var PartalTxType = [
				Constants.TRADE_TYPE_CASH_IN ,     					//现金充值
				Constants.TRADE_TYPE_CHEQUE_IN,					//支票充值
				Constants.TRADE_TYPE_BANK_IN,     					//银行卡充值
				Constants.TRADE_TYPE_ACCUMULATE,					//累积（后台自动充值）
				Constants.TRADE_TYPE_RET_CLIENT,					//中心偿还
				Constants.TRADE_TYPE_CASH_OUT,     				//退现金
				Constants.TRADE_TYPE_CHEQUE_OUT,					//退支票
				Constants.TRADE_TYPE_BANK_OUT,     				//退银行卡
				Constants.TRADE_TYPE_EXPIRE,     					//失效
				Constants.TRADE_TYPE_CLEAR,     					//销户清零
				Constants.TRADE_TYPE_TRANSFER_IN ,     				//转帐
				Constants.TRADE_TYPE_TRANSFER_OUT,     			//转帐
				Constants.TRADE_TYPE_ORG_DIST_IN,     				//单位客户分配
				Constants.TRADE_TYPE_ORG_DIST_OUT,     			//单位客户分配
				Constants.TRADE_TYPE_ORG_COLLECT_IN,     			//单位客户汇总
				Constants.TRADE_TYPE_ORG_COLLECT_OUT,     			//单位客户汇总
				Constants.TRADE_TYPE_CARD_CONSUME ,     			//IC卡消费
				Constants.TRADE_TYPE_SPARE_CONSUME,     			//备用金消费
				Constants.TRADE_TYPE_POINT_EXCHANCE,     			//积分兑换
				Constants.TRADE_TYPE_LOAD_IN,     					//圈存
				Constants.TRADE_TYPE_LOAD_OUT,     				//圈存
				Constants.TRADE_TYPE_UNLOAD_IN,     				//圈提
				Constants.TRADE_TYPE_UNLOAD_OUT,     				//圈提
				Constants.TRADE_TYPE_CARD_RETURN_IN,     			//卡转备用金
				Constants.TRADE_TYPE_CARD_RETURN_OUT     			//卡转备用金
			]
			
			var ACCOUNT_STATUS = [{code:1,text:"正常"},{code:3,text:"失效"}]
			var SUB_ACCOUNT_TYPE = [{code:'2',text:"卡帐户"},{code:'1',text:"备用金帐户"}]
			
			function initPageElements(){
				Page.PresetOrg.issuer = true;
				//Page.issuerSetter(Common.cOrg());
				Page.positive = false;
				Page.sql = "clear_account_list";
				Page.selection.accountType = {list:Clear.AccountType.balance()};
				Common.initDict($('searchForm').status,ACCOUNT_STATUS);
				Common.initDict($('searchForm').subAccountType,SUB_ACCOUNT_TYPE);
				
				Page.columns[4] = {render:
					function(v,r){
						var s = "<a href=# onclick=\"queryTradeItem('"
								+ r[1] + ","
								+ r[2]+"');\">"+v+"<\/a>";
						return s;
					}
				};
				
				setPages(["listView","detailView"]);
		
			}
			
			function queryTradeItem(str){
				var tradeForm = $('tradeForm')
				var strs = str.split(",")
				switchPage('detailView');
				Common._initSelect(tradeForm.tradeType,{list:Common.getSubsetItems("trade_type",PartalTxType),nullLabel:"全    部"});
				//Common.initDict(tradeForm.tradeType, "trade_type", "全 部");
				Common.initDict(tradeForm.tradeStatus, "trade_status", "全 部");
				tradeForm.asn.value = strs[0]
				tradeForm.uniqueId.value = strs[1]
				tradeForm.subAccType.value = strs[0]=='null'?1:2
				tradeForm.accType.value = $('searchForm').accountType.value
				Page.qtTrade = new QueryTable("trade_list","tradeForm","tradeItem",[]);
				Page.qtTrade.showTable()
			}
			
		</script>
	</head>
	<body onload="Clear.List.init()" >
		<div class="nav"><div id="nav">&nbsp;</div></div>
		<div id="listView" >
			<div class="searchForm">
				<form id='searchForm' name='searchForm'>
					<table cellSpacing="0" cellPadding="4" width="100%" border="0">
						<tr>
							<td class="label6" id="issuer"></td>
							<td class="label5">
								<label>卡&nbsp;&nbsp;&nbsp;&nbsp;号</label> 
								<input type="text" name="cardAsn" value="" onblur="checkV(this,'long')">
							</td>
							<td class="label5">
								<label>客户编号</label> 
								<input type="text" name="cardUserUnique" value="" onblur="checkV(this,'uniqueId')">
							</td>
							<td></td>
						</tr>
						<tr>
							<td class="label6">
								<label>帐户类型</label>
								<select name="accountType" onchange="ListPage.changeAccountCode(this)"><option></select>
							</td>
							<td class="label5">
								<label>子帐户类型</label>
								<select name="subAccountType"><option></select>
							</td>
							<td class="label5">
								<label>帐户状态</label>
								<select name="status"><option></select>
							</td>
							<td></td>
						</tr>
						<tr>
							<td class="label6" id="minAmountTd"></td>
							<td class="label5" id="maxAmountTd"></td>
							<td>
							</td>
							<td><button onclick="ListPage.showListTable()">查 询</button></td>
						</tr>
					</table>
				</form>
			</div>
			<div id="datalist"></div>
		</div>
		
		<div id="detailView" style="display:none;">
			<form id="tradeForm" name="tradeForm">
				<input type="hidden" name="asn">
				<input type="hidden" name="uniqueId">
				<input type="hidden" name="accType">
				<input type="hidden" name="subAccType">
				<div class="searchForm">
					<table cellSpacing="0" cellPadding="4" width="100%" border="0">
						<tr>
							<td class="label5">
								<label>交易类型</label> 
								<select name="tradeType"><option></option></select>
							</td>
							<td class="label5">
								<label>交易状态</label> 
								<select name="tradeStatus"><option></option></select>
							<td>
								<button onclick="Page.qtTrade.showTable()">查 询</button>
							</td>
						</tr>
					</table>
				</div>
			</form>
			<div id="tradeItem"></div>
			<p>
				<button onclick="switchPage('listView')">返 回</button>
			</p>
		</div>
	</body>
</html>
